package Day16;

import java.util.Scanner;

public class Text2 {
    public static void main(String[] args) {
        //打印1到100之间的所有能被3整除的数
       /* int start = 40;
        int end  = 200;
        int i = 40;
        while(i >= 40 && i <= 200)
        {
            if(i % 2 == 0){
                System.out.println(i);
            }
            i++;
        }*/

        //打印1到100
       /* int i = 1;
        int sum = 0;
        do{
            System.out.println(i);
            sum += i;
            i++;
        }while(i <= 100);
        System.out.println("1到100的总和是" + sum);
*/
       /* int i = 1;
        int count = 0;
        do{
            if(((i % 5) == 0) && ((i % 3) != 0)){
                System.out.println("i = " + i);
                count++;
            }
            i++;
        }while(i <= 200);
        System.out.println("能够被5整除但是不能被三整除的个数是 " + count+ "个");
*/

        Scanner sc = new Scanner(System.in);
     /*   do{
            System.out.println("还钱吗？y/n");
            String ch = sc.next();
            if(ch.equals("y")){
                break;
            }else if(ch.equals("n")){
                System.out.println("五连鞭");
                continue;
            }else{
                System.out.println("输入有误");
                continue;
            }
        }while(true);
*/

       /* int passNum = 0;
        double bigSum = 0;
        for (int i = 1; i <=3; i++) {
            double sum = 0;
            for(int j = 1; j <= 5; j++){
                System.out.println("请数第"+i+"个班级的第" + j + "个学生的成绩");
                double score = sc.nextDouble();
                if(score >= 60){
                    passNum++;
                }
                sum += score;
                System.out.println("成绩为" + score);

            }
            System.out.println("sum = " + sum + " 平均分是" + (sum / 5));
            bigSum += sum;
        }
        System.out.println("三个班的总分是" + bigSum + "平均分是" + (bigSum / 15)+"及格的人数是" +passNum);

*/

       /* int totalSum = 0;
        int passSum =0;
        int sum = 0;
        for (int i = 1; i <= 3; i++) {
            sum = 0;
            double score;
            for(int j = 1; j <= 5; j++){
                System.out.println("请输入第"+i+"个班级的学生的成绩");
                score = sc.nextDouble();
                if(score >= 60){
                    passSum++;
                }
                sum += score;
                totalSum += score;
                System.out.println("第"+i+"个班级的第"+j+"个学生的分数是" + score);
            }
            System.out.println("班级的总分是" + sum + ", 平均分是" + (sum / 5));
        }
        System.out.println("年纪的总分是" + totalSum + "年级的平均分是" +(totalSum / 15));
        System.out.println("年级的及格人数是" +passSum);
    }*/

        int totalSum = 0;
        double score = 0;
        int passSum = 0;
        for(int i = 1 ;i <= 3; i++){
            int sum = 0;
            for(int j = 1 ; j <= 5; j++){
                System.out.println("please input the "+i+"class and "+j+"score");
                score = sc.nextDouble();
                if(score >= 60){
                    passSum++;
                }
                totalSum += score;
                sum += score;
            }
            System.out.println("this "+i+"class total score is " + sum+"and  this avgsum is" + sum /5);
        }
        System.out.println("this school total score is " + totalSum+"and  this avgsum is" + totalSum /15);
    }
}
